package com.ronipl.createtabs.model.valueobjects;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.Toast;
import com.ronipl.createtabs.R;

public class StarredAction implements OnClickListener {
	
	int StarredBtnPos = 0;
	ImageView starredBtn;
	
	public StarredAction(View view){
		starredBtn = (ImageView)view.findViewById(R.id.starred_item);
	}
	
	@Override
	public void onClick(View v) {
		
		if(StarredBtnPos == 0){
			starredBtn.setImageResource(R.drawable.starstrokestarred);
				StarredBtnPos = 1;
				Toast.makeText(v.getContext(), "You starred this item.", Toast.LENGTH_SHORT).show();
		}
		else if(StarredBtnPos == 1)
		{
			starredBtn.setImageResource(R.drawable.starstroke);
				StarredBtnPos = 0;
				Toast.makeText(v.getContext(), "You un-starred this item.", Toast.LENGTH_SHORT).show();
		}	

	}

}
